package com.danbay.cloud.deviceaccess.client;

import com.danbay.cloud.device.api.dto.DeviceInfoDto;
import com.danbay.cloud.device.api.dto.DeviceLoginDto;
import com.danbay.cloud.device.api.dto.DeviceRegDto;
import com.danbay.cloud.device.api.dto.ReportDataDto;
import com.danbay.framework.exception.BusinessException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author SJG
 */
@FeignClient(name = "device-service")
@RequestMapping("/device-service/device")
public interface DeviceServiceClient {

    @RequestMapping("/register")
    String register(DeviceRegDto regDto) throws BusinessException;

    @RequestMapping("/login")
    void login(@RequestBody DeviceLoginDto loginDto) throws BusinessException;

    @RequestMapping("/logout")
    void logout(@RequestBody DeviceLoginDto loginDto) throws BusinessException;

    @RequestMapping("/report/realData")
    void realData(ReportDataDto reportDataDto) throws BusinessException;

    @RequestMapping("/report/freezeData")
    void freezeData(ReportDataDto reportDataDto) throws BusinessException;

    @RequestMapping("/report/dataReport")
    void dataReport(ReportDataDto reportDataDto) throws BusinessException;

    @RequestMapping("/query/findByMac")
    List<DeviceInfoDto> findByMac(DeviceInfoDto infoDto);

    @RequestMapping("/query/batchFindByMac")
    List<DeviceInfoDto> batchFindByMac(List<DeviceInfoDto> infoDtoList);

}
